const server = require('server')
const message = require('../utils/message')

const {
  get,
  post,
  error
} = server.router

const {
  status
} = server.reply

fn404 = () => status(404).json(message(404, 'not found'))
fn500 = ctx => status(500).json(message(500, ctx.error.message))

module.exports = [
  get(fn404),
  post(fn404),
  error(fn500)
]
